home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / program / cgazv4n3.zip / NETBIOS.H < prev    next >
Text File  |  1990-01-27  |  2KB  |  48 lines

  1. /*********************  NETBIOS.H  --  Listing 1 *********************
  2.  * Purpose: Header file for NETBIOS.C
  3.  * Author: Victor Volkman
  4.  *********************************************************************/
  5.  
  6. #define NAME_LEN 16
  7. typedef unsigned char SESSION;
  8.  
  9. /* The NCB structure must be exactly 64 bytes for NETBIOS to work */
  10.  
  11. typedef struct ncb {          /* NCB = Network Control Block           */
  12.    unsigned char command;     /* Command code                          */
  13.    unsigned char ret_code;    /* Error return value                    */
  14.    SESSION lsn;               /* LSN = Local Session Number            */
  15.    unsigned char num;         /* Index assigned by ADD NAME            */
  16.    char far *buffer;          /* Points to send or receive buffer      */
  17.    unsigned int length;       /* # of bytes to send or receive         */
  18.    char call_name[NAME_LEN];  /* Name of who you want to call          */
  19.    char name[NAME_LEN];       /* Name belonging to you                 */
  20.    unsigned char rto;         /* RTO = Receive Time-Out (in 1/2 secs)  */
  21.    unsigned char sto;         /* STO = Send Time-Out (in 1/2 secs)     */
  22.    void (interrupt far *post_rtn) ();  /* Service routine for no-waits */
  23.    unsigned char lana_num;    /* LAN adapter card number (0 or 1)      */
  24.    unsigned char cmd_cplt;    /* FF = pending, 00 = complete           */
  25.    char reserve[14];          /* NetBIOS use only; do not touch!       */
  26.    } NCB;
  27.  
  28. #define NETBIOS_INT          0x5C
  29.  
  30. /* NCB commands */
  31. #define NETBIOS_ADD_NAME     0x30
  32. #define NETBIOS_CALL         0x10
  33. #define NETBIOS_DELETE_NAME  0x31
  34. #define NETBIOS_HANGUP       0x12
  35. #define NETBIOS_LISTEN       0x11
  36. #define NETBIOS_RECEIVE      0x15
  37. #define NETBIOS_RESET        0x32
  38. #define NETBIOS_SEND         0x14
  39.  
  40. #define NO_WAIT              0x80  /* These flags are ORed into the    */
  41. #define WAIT_FOR             0x00  /* NCB commands as desired.         */
  42.  
  43. /* NCB error codes */
  44. #define CMD_PENDING          0xFF  /* normal return for a NO_WAIT cmd  */
  45.  
  46. /* Misc. values */
  47. #define FALSE                   0
  48. #define TRUE                    1